package cn.com.sqlinterface;
/**
 * 用来保存s数据库查询时需要用到的sql语句
 * @author zjthinkpad
 *
 */
public interface SQLInterface 
{
	//查询用户的总钱数
	String SELECT_ALL_MEONEY = "select user_all_money from poke_user where user_id = ?";
	String BACK_ALL_MONEY = "update poke_user set user_all_money=user_all_money+?  where user_id = ?";
	//在用户初始化之前执行用户信息的更新
	String UPDATE_USERMONEY="update poke_user set user_all_money=? where user_id=?";
	
	//查找是不是已经登陆
	String SLECT_COUNT = "select count(*) from table_user_ref where user_id=?";
	//查询用户的所有信息，用来初始化用户
	//String INIT_USER="select USER_ID,USER_NAME,USER_PASS,USER_PICTURE,USER_ADD,USER_AGE,USER_ALL_MONEY,IS_VIP,user_legend,community,exp_value,charm_value,card_coin " +
	//		"from poke_user where USER_ID=?";
	String INIT_USER="select user_id,user_name,user_pass,user_picture,user_add,user_age,user_all_money,is_vip,user_legend,community,exp_value,charm_value,card_coin,user_home from poke_user where user_id=?";
	//查询出所有的用户信息
	String SELECT_ALL = "select * from poke_user";
	//查询桌子的信息
	String INIT_TABLE ="select table_id,table_name,max_handle,min_handle,big_nate,little_nate,rate,max_link,table_type,community,consume_money from poke_tables where table_id =?";
	//将用户的钱返回到数据库里面
	String BACK_USER_MONEY = "update poke_user set user_all_money =? where user_id =?";
	//在关联表里面插入一条记录
	//String INSER_REF_RECOD = "insert into  table_user_ref(table_id,user_id,table_type)values(?,?,2)";
	String INSER_REF_RECOD="insert into table_user_ref(`table_id`,`user_id`,`user_name`,`user_picture`,`user_all_money`,`user_legend`,`user_home`,`is_vip`,`table_ip`,`table_port`,`user_state`,`table_type`)values(?,?,?,?,?,?,?,?,?,?,0,2)";
	//用户坐下成功，改变这个用户和桌子关联的表
	//String SEAT_SUCCESS = "update table_user_ref set User_State = 1 where user_id = ?";
	String SEAT_SUCCESS = "update table_user_ref set user_state = 1 where user_id = ?";
	//用户离开
	String USER_OUT = "DELETE from table_user_ref where user_id = ?";
	//用户站起
	//String USER_STAND = "update table_user_ref set User_State = 0 where user_id = ?";
	String USER_STAND = "update table_user_ref set user_state = 0 where user_id = ?";
	//给用户增加经验值
	String ADD_CHARMVALUE = "update poke_user set exp_value = exp_value+? where user_id = ?";
	//检查用户是不是在关联列表里面
	String CHECK_USER = "select count(*) from table_user_ref where user_id =?";
	//将用户的钱减去进入VIP场要付出的代价、
	//String DEDCUT_VIP = "update poke_user set USER_ALL_MONEY = USER_ALL_MONEY-? where user_id = ?";
	String DEDCUT_VIP = "update poke_user set user_all_money = user_all_money-? where user_id = ?";
	

}
